class Solution:
    def majorityElement(self, nums):
        dic = {x: 0 for x in set(nums)}
        for i in nums:
            dic[i] = dic[i] + 1
        result = []
        for num in dic:
            if dic[num] > len(nums) // 3:
                result.append(num)
        return result

if __name__ == '__main__':
    so = Solution()
    s = [1,1,1,3,3,2,2,2]
    r = so.majorityElement(s)
    print(r)
